﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace shfa.snomtastic.data
{
    public class UserAgentInfo
    {
        public string Model { get; set; }
        public string Firmware { get; set; }
        public string BootLoader { get; set; }

        public UserAgentInfo(string sUserAgent)
        {
            string[] sOut = SpiltAgent(sUserAgent);
            if (sOut.Length > 3)
                BootLoader = sOut[3];
            else
                BootLoader = string.Empty;

            Model = sOut[1];
            Firmware = sOut[2];

        }

        private string[] SpiltAgent(string sIn)
        {
            string details = sIn.Substring(sIn.IndexOf("("), sIn.Length - sIn.IndexOf("(") - 1);

            return details.Split(' ');


        }


    }
}
